<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
<script type="text/javascript" src="../Ryanjs/login/style.js"></script>
        <link href="../Ryancss/login_public.css" rel="stylesheet" type="text/css"/>
        <link href="../Ryancss/login_style.css" rel="stylesheet" type="text/css"/>

<style>

	   .display-block{
	   display :block ;
	   }
	   
	   .display-none{
	   display :none ;
	   }
	   
	   
</style>

</head>
<body>
<div class="main_login">
    <div class="tit">
        <span class="active_tit">登录</span>
        <span class="sp2" tapmode onclick="openWin('reg_frm')" >注册</span>
        <div class="clear"></div>
    </div>
    <div class="main_box">
        <div class="box_con box_log">
          
                <div class="con_bg">
                    <span class="first_sp"><input type="text" minlength="11" maxlength="11" id="username" placeholder="请输入账号"  /></span>
                    <span class="second_sp thrid_sp"><input  id="password" type="password" placeholder="请输入密码" ></span>
                   <span class="second_sp thrid_sp"  style="display:none"  ><input id="share" type="text" minlength="6" maxlength="6" placeholder="邀请码(选填)"/></span> 
                <!--     <span class="second_sp thrid_sp"  ><input id="share" type="text" minlength="6" maxlength="6" placeholder="邀请码(选填)"/></span> -->
                </div>
                <a onclick="loginTo()" class="log_btn">登录</a>
                <a  tapmode onclick="openWin('repass')" class="forget_btn">忘记密码？</a>
      
        </div>

    </div>
	
	
    <div class="footer_pic">        
	<span  class="display-none" id="display-block-Is_Quick_login" >
		<img  onclick="WX_login()" src="" alt="微信" class="pic2"/>
	</span>
        <img src="" class="pic1"/>
  </div>
</div>


</body>



<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript">
		var api_url = localStorage.getItem('api_url');
		var Other_type = '';

		var qq;
		var wx;
		apiready = function() {
		//	qq = api.require('QQPlus');
		
			wx = api.require('wx');
			api.parseTapmode();
			var header = $api.byId('aui-header');
			$api.fixStatusBar(header);
			var headerPos = $api.offset(header);
			var body_h = $api.offset($api.dom('body')).h;


					
					
					
					
			if(api.pageParam.user) {
				var username = $api.byId('username');
				var password = $api.byId('password');
				password.value = api.pageParam.pass;
				username.value = api.pageParam.user;

			}
			
		/*	if(api.systemType == 'ios') {
				var az = $api.byId('login_az');
				az.remove();
			}else{
				var ios = $api.byId('login_ios');
				ios.remove();
			}
*/
				
			
			//微信快捷登录是否开放
			if(localStorage.getItem('Is_Quick_login') ==1){
			
				var obj = document.getElementById("display-block-Is_Quick_login");
				obj.setAttribute("class", "display-block");
			}



			
			

		}

		function closeWin() {
			api.closeWin({});
		}

		// function toWin(name){
		//   api.closeToWin({
		//       name: name
		//   });
		// }

		function openWin(name) {
			var delay = 0;
			if(api.systemType != 'ios') {
				delay = 300;
			}
			api.openWin({
				name: name,
				url: name + '.html',
				bounces: false,
				delay: delay,
				slidBackEnabled: true,
				bgColor: '#000',
				animation: {
					type: "reveal", //动画类型（详见动画类型常量）
			//		subType: "from_bottom", //动画子类型（详见动画子类型常量）
					duration: 400
				},
				vScrollBarEnabled: false
			});
		}

		function loginTo() {
			var username = $api.val($api.byId('username'));
			var password = $api.val($api.byId('password'));

			if(username == '') {

				api.toast({
					msg: '账号都没输入',
					duration: 5000,
					location : 'middle' 
				});
				return;
			}
			if(password == '') {

				api.toast({
					msg: '密码还没输入',
					duration: 5000,
					location : 'middle' 
				});
				return;
			}

			api.closeWin({
				name: 'reg_frm'
			});
			
			//请求数据库并存储用户信息
			var api_url = localStorage.getItem('api_url');
			api.ajax({
				url: api_url+'/login/login/veifys.html',
				method: 'get',
				data: {
					values: {
						key: 'ikmovie.xyz',   //安全码
						username: username,
						passwd: password,
						imei: api.deviceId
					}
				}
			}, function(ret, err) {
				if(ret) {
					if(ret.code == 9) { //封禁
					
						
					api.hideProgress();
					
						api.toast({
							msg: ret.status,  
							duration: 5000,
							location : 'middle' 
							});



						return;	
					}else if(ret.code == 8){	//开启设备限制
					
					
					api.hideProgress();
					
							api.toast({
							msg: ret.status,  
							duration: 5000,
							location : 'middle' 
							});

						return;	
					
					}else if(ret.code == 3) {
					
					
					api.hideProgress();
					
						api.toast({
							msg: '安全码错误 请联系微信 qq1207629473',
							duration: 5000,
							location : 'middle' 
						});

						return;
					}else if(ret.code == 0) {
						/*    api.hideProgress();
                alert('账号或密码不正确');
  原弹窗提示  */
  
  
					api.hideProgress();
					
					
						api.toast({
							msg: '账号或密码不正确',
							duration: 5000,
							location : 'middle' 
						});

						return;
					} else if(ret.code == 1) {
						/*       alert('登录成功');
						      原弹窗提示  */
							  
						
							  
						api.toast({
							msg: '登陆成功！',
							duration: 5000,
							location : 'middle' 
						});

						//alert( JSON.stringify( ret ) );
						
						localStorage.setItem('accountLogin',0);
						localStorage.setItem('user_name', username);
						localStorage.setItem('password', password);
						localStorage.setItem('user_id', ret.msg['id']);					//用户ID
						localStorage.setItem('parentid', ret.msg['parentid']);			//父ID
						localStorage.setItem('nick_name', ret.msg['nick_name']);			//昵称
						localStorage.setItem('status', ret.msg['status']);					//封号状态
						localStorage.setItem('app_name', ret.msg['app_name']);					//APP名字
						localStorage.setItem('player_starttimes', ret.msg['player_starttimes']);					//播放器记录设置
						localStorage.setItem('user_name', username);					//用户名
						localStorage.setItem('password', password);					//密码
						localStorage.setItem('user_time', ret.msg['time']);				//会员到期时间
						localStorage.setItem('share_ma', ret.msg['share_ma']);			//邀请码
						localStorage.setItem('sign', ret.msg['sign']);				//积分
						localStorage.setItem('money', ret.msg['money']);			//余额
						localStorage.setItem('headimgurl', ret.msg['headimgurl']);			//头像
						localStorage.setItem('txje', ret.msg['txje']);			//提现金额
						localStorage.setItem('vip1', ret.msg['vip1']);			//体验
						localStorage.setItem('vip2', ret.msg['vip2']);			//月卡
						localStorage.setItem('vip3', ret.msg['vip3']);			//季卡
						localStorage.setItem('vip4', ret.msg['vip4']);			//半年
						localStorage.setItem('vip5', ret.msg['vip5']);			//一年
						localStorage.setItem('vip6', ret.msg['vip6']);			//永久
						localStorage.setItem('daili_price', ret.msg['daili_price']);			//代理升级价格
						localStorage.setItem('zfb', ret.msg['zfb']);			//支付宝
						localStorage.setItem('qdtime', ret.msg['qdtime']);			//签到时间
					//	localStorage.setItem('user_advert', ret.msg['advert']);
					//	localStorage.setItem('user_code', ret.msg['code']);			
						localStorage.setItem('user_weichat', ret.msg['weichat']);			//上级微信
						localStorage.setItem('tudi', ret.msg['tudi']);			//团队数量
						localStorage.setItem('power', ret.msg['power']);			//权限
						localStorage.setItem('Source', ret.msg['Source']);			//来源
						
						localStorage.setItem('app_working_mode', ret.msg['app_working_mode']);			//APP 工作模式   
						localStorage.setItem('vip_movies_theme', ret.msg['vip_movies_theme']);			//VIP 影视主题
						localStorage.setItem('app_share_help', ret.msg['app_share_help']);			//APP邀请页帮助信息
						localStorage.setItem('app_Invitation_slogans', ret.msg['app_Invitation_slogans']);			//APP分享 邀请标语
						localStorage.setItem('app_secret_key', ret.msg['app_secret_key']);			//APP 私人影片kEY
						localStorage.setItem('app_secret_content', ret.msg['app_secret_content']);			//APP 私人影片公告
						localStorage.setItem('index_video_num', ret.msg['index_video_num']);			//首页调用推荐影视数量
						localStorage.setItem('look_record_num', ret.msg['look_record_num']);			//观看记录保留数量
						localStorage.setItem('upload_headimg_integral', ret.msg['upload_headimg_integral']);			//上传头像赠送积分
						localStorage.setItem('set_nickname_integral', ret.msg['set_nickname_integral']);			//设置昵称赠送积分
						localStorage.setItem('upload_alipay_code_integral', ret.msg['upload_alipay_code_integral']);			//上传支付宝收款码赠送积分
						localStorage.setItem('wechat_login_code_integral', ret.msg['wechat_login_code_integral']);			//微信快捷登录赠送积分
						localStorage.setItem('agent_introduction_picture', ret.msg['agent_introduction_picture']);			//代理升级介绍图片
						localStorage.setItem('agent_upgrade_tips', ret.msg['agent_upgrade_tips']);			//会员中心无代理权限弹窗提示
						localStorage.setItem('touping_switch', ret.msg['touping_switch']);			//会员中心投屏助手按钮开关
						localStorage.setItem('touping_picture', ret.msg['touping_picture']);			//会员中心投屏助手介绍图片
						api.sendEvent({
							name: 'newLoingdata',
							extra: {}
						});

						api.hideProgress();

						api.closeWin({});

						// api.openWin({
						//     name: 'index',
						//     url: '../index.html',
						// });

					}
				} else {
					api.hideProgress();
					/*   alert('网络错误！');
					      原弹窗提示*/
					api.toast({
						msg: '网络错误 请检查1！',
						duration: 5000,
							location : 'middle' 
					});

					//alert( JSON.stringify( err ) );
					return;
				}
			});
		}
		
/*
		//QQ登陆
		function QQ_login() {
			qq.login(function(ret, err) {
				if(ret.status) {
					Other_type = 'QQ';
					QQ_getUserInfo(ret.openId);
				} else {
					//alert(JSON.stringify(err))
					alert('QQ授权失败，请尝试重新登陆！')
				}
			});
		}
		//获取qq信息
		function QQ_getUserInfo(QID) {
			// city ：用户所在城市
			// figureurl_qq_2   ：用户大头像（100）地址
			// gender        ：用户性别
			// is_yellow_vip  ：是否为黄钻用户
			// level         ：用户账号级别
			// nickname  ：用户昵称
			// province    ：用户所在省份
			// yellow_vip_level   ：用户账户黄钻等级
			qq.getUserInfo(function(ret, err) {
				if(ret.status) {
					//alert(JSON.stringify(ret));
					ret.info = JSON.parse(ret.info)
					localStorage.setItem('Other_name', ret.info.nickname); // nickname  ：用户昵称
					localStorage.setItem('qq_city', ret.info.city); // city ：用户所在城市
					localStorage.setItem('Other_img', ret.info.figureurl_qq_2); // figureurl_qq_2   ：用户大头像（100）地址
					localStorage.setItem('Other_openid', QID); // openid ：用户openid
					Other_Reg();
				} else {
					//alert(JSON.stringify(err))
					alert('用户信息获取失败，请尝试重新登陆！')
				}
			});
		}
		
		*/

		//微信调用登陆
		function WX_login() {
						
					
			  var clipBoard = api.require('clipBoard');
			  clipBoard.get(function(ret, err) {
				  if (ret) {

					if (ret.value.length == 6) {
					  var share = $api.byId('share');
					  share.value = ret.value;
				/*	  api.toast({
						  msg: '绑定归属成功',
						  duration: 4000,
						  location: 'middle' 
					  });
					  */
					}
				  } else {

				  }
			  });


	
		
		
						
						
			wx.auth(function(ret, err) {
				if(ret.status) {
					//alert(JSON.stringify(ret));
					WX_auth(ret.code)
					
					
					
					
				} else {
					if(err.code == 1) {
						/*
						alert('微信授权失败！请稍后重试！');
						*/
						
						
					api.toast({
						msg: '微信授权失败！请稍后重试！',
						duration: 5000,
					location : 'middle' 
					});

						
					}
				}
			});
		}

		function WX_auth(code) {
			

			var auth_code = code;
			
				
			
			wx.getToken({
				apiKey: '',
				apiSecret: '', 
				code: auth_code
			}, function(ret, err) {
				if(ret.status) {
					//alert(JSON.stringify(ret));
					Other_type = '微信';
					
			
					
					localStorage.setItem('Other_accessToken', ret.accessToken); // openid ：用户openid
					var openId = ret.openId;
					var accessToken = ret.accessToken;
					
					
					WX_getUserInfo(openId, accessToken);
				} else {
				
					/*alert(err.code);  */
					api.toast({
						msg: '微信快捷登陆配置错误',
						duration: 5000,
					location : 'middle' 
					});					
					
				}
			});
		}
		//获取微信信息
		function WX_getUserInfo(Other_openid, Other_accessToken) {
			//布尔型；true||false
			//openid: '',        //字符串类型；普通用户的标识，对当前开发者帐号唯一
			//nickname: '',      //字符串类型；普通用户昵称
			//sex: 1,            //数字类型；普通用户性别，1为男性，2为女性
			//headimgurl: '',    //字符串类型；用户头像，最后一个数值代表正方形头像大小（有0、46、64、96、132数值可选，0代表640*640正方形头像），用户没有头像时该项为空
			//privilege: [],     //数组类型；用户特权信息，如微信沃卡用户为（chinaunicom）
			//unionid: ''        //字符串类型；用户统一标识。针对一个微信开放平台帐号下的应用，同一用户的unionid是唯一的。
			var accessToken = Other_accessToken;
			var openId = Other_openid;
			wx.getUserInfo({
				accessToken: accessToken,
				openId: openId
			}, function(ret, err) {
				if(ret.status) {
					//alert(JSON.stringify(ret));
					localStorage.setItem('Other_name', ret.nickname); // nickname  ：用户昵称
					localStorage.setItem('Other_img', ret.headimgurl); // figureurl_qq_2   ：用户大头像（100）地址
					localStorage.setItem('Other_openid', openId); // openid ：用户openid




										api.ajax({
										url: api_url+'/login/login/is_wechat_register.html',
										method: 'get',
										data: {
											values: {
												key: 'ikmovie.xyz',   //安全码
												username: localStorage.getItem('Other_openid')
											}
										}
									}, function(ret, err) {
										if(ret) {
												if(ret.cun == 1) { //当前用户已存在
												
												//	api.toast({
												//		msg: '存在存在',
												//		duration: 5000,
												//	location : 'middle' 
												//	});	
													
														denglu();    // 直接登录

												}else{
												
													Other_Reg();   //     不存在就注册
												}

											}else{
											//获取失败 网络错误
													api.toast({
														msg: '网络连接异常',
														duration: 5000,
													location : 'middle' 
													});	


											}

										});



				//	Other_Reg();
					
					
				} else {
													api.toast({
														msg: '微信授权信息获取失败',
														duration: 5000,
													location : 'middle' 
													});	

				}
			});
		}








		function Other_Reg(){
			var user = localStorage.getItem('Other_openid');
			var pass = localStorage.getItem('Other_openid');
			var Other_name = localStorage.getItem('Other_name');
			var Other_img = localStorage.getItem('Other_img');
			
		//	var share_code = '124124214124';   //////////
			var share_code = $api.val($api.byId('share'));     //邀请码
					
				
				
				//	api.toast({
				//		msg: share_code,
				//		duration: 5000,
				//	location : 'middle' 
				//	});	
					
				
				//			return;
				


							if(share_code == ''){
	   
	   
												var dialogBox = api.require('dialogBox');
												dialogBox.alert({
													texts: {  
													//	title: '智能识别',
														content: '请向邀请人索取正确邀请码',
														leftBtnTitle: '知道了',
													//	rightBtnTitle: '确认并使用'
													},
													styles: {
														bg: '#fff',
														w: 300,
														corner:10,
														title: {
															marginT: 20,
															icon: 'widget://Ryanimg/frame0/rrrr.png',
															iconSize: 20,
															titleSize: 14,
															titleColor: '#999'
														},
														content: { 
															marginT: 20,       //（可选项）数字类型；内容文本顶端与标题栏底端的距离，如果标题栏不存在，则是到窗口顶端的距离；默认：20
															marginB: 20,       //（可选项）数字类型；内容文本底端与 left/right 顶端的距离，如果 left/right 都不存在，则是到对话框底端的距离；默认：20
															color: '#999',
															size: 14 
														},
														left: {
															marginB: 30,
															marginL: 100,
															w: 100,
															h: 35,
															corner: 2,
															bg: '#eeeeee',
															color: '#999',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
															size: 12
														}
														
														
													}
												}, function(ret) {
																			
																				if (ret.eventType == 'left') {
																				
																					//关闭弹窗
																					var dialogBox = api.require('dialogBox');
																					dialogBox.close({
																						dialogName: 'alert'
																					});
																					

																					
																					//清空剪贴板
																					var clipBoard = api.require('clipBoard');
																					clipBoard.set({
																						value: '爱看资源网' 
																					});																				
																					

																				} 
																				
																			}); 			
																			
																			
																	 return;
																   }




		api.showProgress({
          title: Other_type + '注册中',
          text: '请稍等',
          modal: false
      });

			api.ajax({
				url: api_url+'/login/login/weixin_create.html',   //注册
				method: 'get',
				data: {
					values: {
						key: 'ikmovie.xyz',   //安全码
						name: user,
						password: pass, 
						share_ma: share_code,
						deviceId: api.deviceId,
						nick_name: Other_name,
						headimgurl: Other_img,
						type: Other_type
					}
				}
			}, function(ret, err) {
				if(ret) {
				
							if (ret.code == 10) {    //  账户已存在  
						
								
								api.toast({
									msg: ret.msg,
									duration: 5000,
								location : 'middle' 
								});

							
							}else if (ret.code == 9) {     // 请向邀请人索取正确邀请码
							
							
								api.toast({
									msg: ret.msg,
									duration: 5000,
								location : 'middle' 
								});

							
							}else if (ret.code == 0) {     // 您已注册过账户   安全码错误   注册失败
							
							
								api.toast({
									msg: ret.msg,
									duration: 5000,
								location : 'middle' 
								});

							
							}else if (ret.code == 1) {    //注册成功
							
															//准备登录
									api.toast({
										msg: '注册成功', 
										duration: 5000,
									location : 'middle' 
									});	
									
				denglu();
							
							
							}
				
	
					api.hideProgress();
					
				} else {
					api.hideProgress();
					

					
					
					api.toast({
						msg: '网络错误！',
						duration: 5000,
					location : 'middle' 
					});

					
				}
			});
		}
		






/*

		function Other_Reg() {
			var user = localStorage.getItem('Other_openid');
			var pass = localStorage.getItem('Other_openid');
			var Other_name = localStorage.getItem('Other_name');
			var Other_img = localStorage.getItem('Other_img');
			
		//	var share_code = '124124214124';   //////////
			var share_code = $api.val($api.byId('share'));     //邀请码
					
				
				
				//	api.toast({
				//		msg: share_code,
				//		duration: 5000,
				//	location : 'middle' 
				//	});	
					
				
				//			return;
				


       if(share_code == ''){
	   
	   
												var dialogBox = api.require('dialogBox');
												dialogBox.alert({
													texts: {  
													//	title: '智能识别',
														content: '请向邀请人索取正确邀请码',
														leftBtnTitle: '知道了',
													//	rightBtnTitle: '确认并使用'
													},
													styles: {
														bg: '#fff',
														w: 300,
														corner:10,
														title: {
															marginT: 20,
															icon: 'widget://Ryanimg/frame0/rrrr.png',
															iconSize: 20,
															titleSize: 14,
															titleColor: '#999'
														},
														content: { 
															marginT: 20,       //（可选项）数字类型；内容文本顶端与标题栏底端的距离，如果标题栏不存在，则是到窗口顶端的距离；默认：20
															marginB: 20,       //（可选项）数字类型；内容文本底端与 left/right 顶端的距离，如果 left/right 都不存在，则是到对话框底端的距离；默认：20
															color: '#999',
															size: 14 
														},
														left: {
															marginB: 30,
															marginL: 100,
															w: 100,
															h: 35,
															corner: 2,
															bg: '#eeeeee',
															color: '#999',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
															size: 12
														}
														
														
													}
												}, function(ret) {
																			
																				if (ret.eventType == 'left') {
																				
																					//关闭弹窗
																					var dialogBox = api.require('dialogBox');
																					dialogBox.close({
																						dialogName: 'alert'
																					});
																					

																					
																					//清空剪贴板
																					var clipBoard = api.require('clipBoard');
																					clipBoard.set({
																						value: '爱看资源网' 
																					});																				
																					

																				} 
																				
																			}); 			
				
				
         return;
       }





		
			api.ajax({
				url: 'http://mk.ikmovie.xyz/login/login/create.html',   //注册
				method: 'get',
				data: {
					values: {
						key: 'ikmovie.xyz',   //安全码
						name: user,
						password: pass, 
						share_ma: share_code,
						deviceId: api.deviceId,
						nick_name: Other_name,
						headimgurl: Other_img,
						type: Other_type
					}
				}
			}, function(ret, err) {
				if(ret) {
				
				
				
				
				
					if(ret.code == 0) {   //为0的情况有  设备识别开启  注册失败   安全码错误   账户已存在
								if(ret.cun == 1) { //当前用户已存在
									api.showProgress({
										title: Other_type + '登录中',
										text: '请稍等',
										modal: false
									});
									api.ajax({
										url: 'http://mk.ikmovie.xyz/login/login/veifys.html',
										method: 'get',
										data: {
											values: {
												key: 'ikmovie.xyz',   //安全码
												username: localStorage.getItem('Other_openid'),
												passwd: localStorage.getItem('Other_openid'),
												imei: api.deviceId
											}
										}
									}, function(ret, err) {
										if(ret) {
												if(ret.code == 9) { //封禁
												
												
												
														api.hideProgress();	  
														
												
													api.toast({
														msg: ret.status,  
														duration: 5000,
														location : 'middle' 
														});


													return;	
												}else if(ret.code == 8){	//开启设备限制
												
														api.hideProgress();	  
														
														
														api.toast({
														msg: ret.status,  
														duration: 5000,
														location : 'middle' 
														});

													return;	
												
												}else if(ret.code == 3) {
												
												
												
														api.hideProgress();	  
														
														
													api.toast({
														msg: '安全码错误 请联系微信 qq1207629473',
														duration: 5000,
														location : 'middle' 
													});

													return;
												}else if(ret.code == 0) {
												
												
												
														api.hideProgress();	  
														
														
													api.toast({
														msg: '账号或密码不正确',
														duration: 5000,
														location : 'middle' 
													});

													return;
												} else if(ret.code == 1) {
												
													api.toast({
														msg: '登陆成功！',
														duration: 5000,
														location : 'middle' 
													});

													//alert( JSON.stringify( ret ) );
													
													localStorage.setItem('accountLogin',0);
													
													localStorage.setItem('user_id', ret.msg['id']);
													localStorage.setItem('user_name', username);
													localStorage.setItem('password', password);
													localStorage.setItem('user_time', ret.msg['time']);
													localStorage.setItem('user_share', ret.msg['share_ma']);
													localStorage.setItem('user_yongjin', ret.msg['money']);
													localStorage.setItem('user_advert', ret.msg['advert']);
													localStorage.setItem('user_code', ret.msg['code']);
													localStorage.setItem('user_weichat', ret.msg['weichat']);
												//	localStorage.setItem('user_status', ret.msg['status']);
												//	localStorage.setItem('user_power', ret.msg['power']);
												//	localStorage.setItem('user_qiandao', ret.msg['qdtime']);
												//	localStorage.setItem('user_txje', ret.msg['txje']);
													localStorage.setItem('url', ret.msg['url']);
													localStorage.setItem('url1', ret.msg['url1']);
													localStorage.setItem('url2', ret.msg['url2']);
													localStorage.setItem('url3', ret.msg['url3']);
													localStorage.setItem('url4', ret.msg['url4']);
													api.sendEvent({
														name: 'newLoingdata',
														extra: {}
													});

													api.hideProgress();

													api.closeWin({});

													// api.openWin({
													//     name: 'index',
													//     url: '../index.html',
													// });

												}
										} else {
											api.hideProgress();
											alert(ret.msg);
											//alert( JSON.stringify( err ) );
											return;
										}
									});
								} else {
									api.hideProgress();
									

												
									
									
									api.toast({
										msg: ret.msg,
										duration: 5000,
									location : 'middle' 
									});
					
									
								}

							} else {
								denglu()
							}
				} else {
					api.hideProgress();
					

					
					
					api.toast({
						msg: '网络错误！',
						duration: 5000,
					location : 'middle' 
					});

					
				}
			});
		}
		
		
	*/	
		
		
		
		
	
		
		
		//注册并登录
		function denglu(){
			
						localStorage.setItem('accountLogin',1);
			var user = localStorage.getItem('Other_openid');
			var pass = localStorage.getItem('Other_openid');
			api.showProgress({
				title: '处理中',
				text: '请稍等',
				modal: false
			});
			api.ajax({
				url: api_url+'/login/login/veifys.html',
				method: 'get',
				data: {
					values: {
						key: 'ikmovie.xyz',   //安全码
						username: user,
						passwd: pass,
						imei: api.deviceId
					}
				}
			}, function(ret, err) {
				if(ret) {
					if(ret.code == 9) { //封禁
						api.hideProgress();
						api.toast({
							msg: ret.status,  
							duration: 5000,
							location : 'middle' 
							});

						return;	
					}else if(ret.code == 8){	//开启设备限制
						api.hideProgress();
							api.toast({
							msg: ret.status,  
							duration: 5000,
							location : 'middle' 
							});

						return;	
					
					}else if(ret.code == 3) {
						api.hideProgress();
						api.toast({
							msg: '安全码错误 请联系微信 qq1207629473',
							duration: 5000,
							location : 'middle' 
						});

						return;
					}else if(ret.code == 0) {
						api.hideProgress();
						api.toast({
							msg: ret.msg,
							duration: 5000,
							location : 'middle' 
						});

						return;
					}else if(ret.code == 10) {
						api.hideProgress();
						
					
					//	api.toast({
					//		msg: ret.msg,
					//		duration: 5000,
					//		location : 'middle' 
					//	});
						
						
						
											  
												var dialogBox = api.require('dialogBox');
												dialogBox.alert({
													texts: {  
													//	title: '智能识别',
														content: ret.msg,
														leftBtnTitle: '知道了',
													//	rightBtnTitle: '确认并使用'
													},
													styles: {
														bg: '#fff',
														w: 300,
														corner:10,
														title: {
															marginT: 20,
															icon: 'widget://Ryanimg/frame0/rrrr.png',
															iconSize: 20,
															titleSize: 14,
															titleColor: '#999'
														},
														content: { 
															marginT: 20,       //（可选项）数字类型；内容文本顶端与标题栏底端的距离，如果标题栏不存在，则是到窗口顶端的距离；默认：20
															marginB: 20,       //（可选项）数字类型；内容文本底端与 left/right 顶端的距离，如果 left/right 都不存在，则是到对话框底端的距离；默认：20
															color: '#999',
															size: 14 
														},
														left: {
															marginB: 30,
															marginL: 100,
															w: 100,
															h: 35,
															corner: 2,
															bg: '#eeeeee',
															color: '#999',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
															size: 12
														}
														
														
														
													}
												}, function(ret) {
																			
																				if (ret.eventType == 'left') {
																				
																					//关闭弹窗
																					var dialogBox = api.require('dialogBox');
																					dialogBox.close({
																						dialogName: 'alert'
																					});
																					

																					
																					
																					//清空剪贴板
																					var clipBoard = api.require('clipBoard');
																					clipBoard.set({
																						value: '爱看资源网' 
																					});																				
																					
																																										
																					
																					
																				}
																				
																			}); 	

						return;
					} else if(ret.code == 1) {
						api.hideProgress();
						api.toast({
							msg: '登陆成功！',
							duration: 5000,
							location : 'middle' 
						});

						//alert( JSON.stringify( ret ) );
						
						localStorage.setItem('accountLogin',0);
						
						
						localStorage.setItem('user_id', ret.msg['id']);					//用户ID
						localStorage.setItem('nick_name', ret.msg['nick_name']);			//昵称
						localStorage.setItem('parentid', ret.msg['parentid']);			//父ID
						localStorage.setItem('status', ret.msg['status']);					//封号状态
						localStorage.setItem('app_name', ret.msg['app_name']);					//APP名字
						localStorage.setItem('player_starttimes', ret.msg['player_starttimes']);					//播放器记录设置
						localStorage.setItem('user_name', user);					//用户名
						localStorage.setItem('password', pass);					//密码
						localStorage.setItem('user_time', ret.msg['time']);				//会员到期时间
						localStorage.setItem('sign', ret.msg['sign']);				//积分
						localStorage.setItem('share_ma', ret.msg['share_ma']);			//邀请码
						localStorage.setItem('money', ret.msg['money']);			//余额
						localStorage.setItem('headimgurl', ret.msg['headimgurl']);			//头像
						localStorage.setItem('txje', ret.msg['txje']);			//提现金额
						localStorage.setItem('vip1', ret.msg['vip1']);			//体验
						localStorage.setItem('vip2', ret.msg['vip2']);			//月卡
						localStorage.setItem('vip3', ret.msg['vip3']);			//季卡
						localStorage.setItem('vip4', ret.msg['vip4']);			//半年
						localStorage.setItem('vip5', ret.msg['vip5']);			//一年
						localStorage.setItem('vip6', ret.msg['vip6']);			//永久
						localStorage.setItem('daili_price', ret.msg['daili_price']);			//代理升级价格
						localStorage.setItem('zfb', ret.msg['zfb']);			//支付宝
						localStorage.setItem('qdtime', ret.msg['qdtime']);			//签到时间
					//	localStorage.setItem('user_advert', ret.msg['advert']);
					//	localStorage.setItem('user_code', ret.msg['code']);			
						localStorage.setItem('user_weichat', ret.msg['weichat']);			//上级微信
						localStorage.setItem('tudi', ret.msg['tudi']);			//团队数量
						localStorage.setItem('power', ret.msg['power']);			//权限
						localStorage.setItem('Source', ret.msg['Source']);			//来源
						
						localStorage.setItem('app_working_mode', ret.msg['app_working_mode']);			//APP 工作模式   
						localStorage.setItem('vip_movies_theme', ret.msg['vip_movies_theme']);			//VIP 影视主题
						localStorage.setItem('app_share_help', ret.msg['app_share_help']);			//APP邀请页帮助信息
						localStorage.setItem('app_Invitation_slogans', ret.msg['app_Invitation_slogans']);			//APP分享 邀请标语
						localStorage.setItem('app_secret_key', ret.msg['app_secret_key']);			//APP 私人影片kEY
						localStorage.setItem('app_secret_content', ret.msg['app_secret_content']);			//APP 私人影片公告
						localStorage.setItem('index_video_num', ret.msg['index_video_num']);			//首页调用推荐影视数量
						localStorage.setItem('look_record_num', ret.msg['look_record_num']);			//观看记录保留数量
						localStorage.setItem('upload_headimg_integral', ret.msg['upload_headimg_integral']);			//上传头像赠送积分
						localStorage.setItem('set_nickname_integral', ret.msg['set_nickname_integral']);			//设置昵称赠送积分
						localStorage.setItem('upload_alipay_code_integral', ret.msg['upload_alipay_code_integral']);			//上传支付宝收款码赠送积分
						localStorage.setItem('wechat_login_code_integral', ret.msg['wechat_login_code_integral']);			//微信快捷登录赠送积分
						localStorage.setItem('agent_introduction_picture', ret.msg['agent_introduction_picture']);			//代理升级介绍图片
						localStorage.setItem('agent_upgrade_tips', ret.msg['agent_upgrade_tips']);			//会员中心无代理权限弹窗提示
						localStorage.setItem('touping_switch', ret.msg['touping_switch']);			//会员中心投屏助手按钮开关
						localStorage.setItem('touping_picture', ret.msg['touping_picture']);			//会员中心投屏助手介绍图片
						api.sendEvent({
							name: 'newLoingdata',
							extra: {}
						});

						api.hideProgress();

						api.closeWin({});

						// api.openWin({
						//     name: 'index',
						//     url: '../index.html',
						// });

					}
				} else {
					api.hideProgress();
					api.toast({
						msg: '网络错误 请检查2！',
						duration: 5000,
							location : 'middle' 
					});

					//alert( JSON.stringify( err ) );
					return;
				}
			}
			
			
			

			
			
			
			);
		}
		

		
		
	</script>


</html>